/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.wechat.entity;

import com.bifrost.wechat.constant.WechatAccountType;

import javax.persistence.*;

/**
 *
 *
 *@author joewee
 *@version 1.0.0
 *@Date 2018/2/22 14:19
 */
@Entity
@Table(name = "WECHAT_ACCOUNT")
@NamedQuery(name = "WechatAccount.findAll", query = "SELECT p FROM WechatAccount p")
public class WechatAccount {
    /**主键*/
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**公众帐号名称*/
    @Column(name="ACCOUNT_NAME",nullable = false)
    private String accountName;
    /**公众帐号TOKEN*/
    @Column(name="TOKEN")
    private String token;
    /**公众原始ID*/
    @Column(name="APP_ID",length = 32,nullable = false,unique = true)
    private String appId;
    @Column(name="APP_SECRET")
    private String appSecret;
    @Column(name="AES_KEY")
    private String aesKey;
    /**公众号类型*/
    @Column(name="ACCOUNT_TYPE")
    @Enumerated(value = EnumType.STRING)
    private WechatAccountType accounttype = WechatAccountType.MP;

    @Column(name = "MERCHANT_ID")
    private Long storeId;

    @Column(name = "STORE_CODE",length = 8)
    private String storeCode;
    /**
     * 商户号
     * */
    @Column(name="MCH_ID")
    private Long mchId;
    /**
     * 商户key
     * */
    @Column(name="MCH_KEY")
    private String mchKey;
    /**
     * 子商户号
     * */
    @Column(name="SUB_APP_ID")
    private String subAppId;
    @Column(name="SUB_MCH_ID")
    private Long subMchId;
    @Column(name="KEY_PATH")
    private String keyPath;
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getAesKey() {
        return aesKey;
    }

    public void setAesKey(String aesKey) {
        this.aesKey = aesKey;
    }

    public WechatAccountType getAccounttype() {
        return accounttype;
    }

    public void setAccounttype(WechatAccountType accounttype) {
        this.accounttype = accounttype;
    }

    public Long getStoreId() {
        return storeId;
    }

    public void setStoreId(Long storeId) {
        this.storeId = storeId;
    }

    public Long getMchId() {
        return mchId;
    }

    public void setMchId(Long mchId) {
        this.mchId = mchId;
    }

    public String getMchKey() {
        return mchKey;
    }

    public void setMchKey(String mchKey) {
        this.mchKey = mchKey;
    }

    public String getSubAppId() {
        return subAppId;
    }

    public void setSubAppId(String subAppId) {
        this.subAppId = subAppId;
    }

    public Long getSubMchId() {
        return subMchId;
    }

    public void setSubMchId(Long subMchId) {
        this.subMchId = subMchId;
    }

    public String getKeyPath() {
        return keyPath;
    }

    public void setKeyPath(String keyPath) {
        this.keyPath = keyPath;
    }

    public String getStoreCode() {
        return storeCode;
    }

    public void setStoreCode(String storeCode) {
        this.storeCode = storeCode;
    }
}
